package dailyProgram02;

import java.util.ArrayList;

public class perfectNumber {
	public static void main(String[] args) {
		for(int i=1;i<=1000;i++) {
			if(isPerfectNumber(i)) {
				System.out.println(i+"是完数");
			}
		}
	}

	private static boolean isPerfectNumber(int i) {
		int devided=i,sum=0;
		for(int j = 1;j<i;j++) {
			if(i%j==0) {
				sum+=j;
			}
		}
		if(sum==i) {
			return true;
		}else {
			return false;
		}
	}
}
